import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
    {
        name: 'MenuDetail',
        meta: {
            title: '菜单首页'
        },
        path: '/',
        component: () => import('@/pages/MenuDetail')
    },
    {
        name: 'ShoppingCart',
        meta: {
            title: '购物车'
        },
        path: '/shopping-cart',
        component: () => import('@/pages/ShoppingCart')
    },
    {
        name: 'Order',
        meta: {
            title: '我的订单'
        },
        path: '/order',
        component: () => import('@/pages/Order')
    }
]

const router = new VueRouter({
    routes
})

// 路由拦截
// router.beforeEach((to, from, next) => {
// })

export default router